class MilitaroriginsController < ApplicationController
  # GET /militarorigins
  # GET /militarorigins.xml
  def index
    @militarorigins = Militarorigin.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @militarorigins }
    end
  end

  # GET /militarorigins/1
  # GET /militarorigins/1.xml
  def show
    @militarorigin = Militarorigin.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @militarorigin }
    end
  end

  # GET /militarorigins/new
  # GET /militarorigins/new.xml
  def new
    @militarorigin = Militarorigin.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @militarorigin }
    end
  end

  # GET /militarorigins/1/edit
  def edit
    @militarorigin = Militarorigin.find(params[:id])
  end

  # POST /militarorigins
  # POST /militarorigins.xml
  def create
    @militarorigin = Militarorigin.new(params[:militarorigin])
    @miltarorigin.id = params[:id]

    respond_to do |format|
      if @militarorigin.save
        flash[:notice] = 'Militarorigin was successfully created.'
        format.html { redirect_to(militarorigins_url) }
        format.xml  { render :xml => @militarorigin, :status => :created, :location => @militarorigin }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @militarorigin.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /militarorigins/1
  # PUT /militarorigins/1.xml
  def update
    @militarorigin = Militarorigin.find(params[:id])

    respond_to do |format|
      if @militarorigin.update_attributes(params[:militarorigin])
        flash[:notice] = 'Militarorigin was successfully updated.'
        format.html { redirect_to(militarorigins_url) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @militarorigin.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /militarorigins/1
  # DELETE /militarorigins/1.xml
  def destroy
    @militarorigin = Militarorigin.find(params[:id])
    @militarorigin.destroy

    respond_to do |format|
      format.html { redirect_to(militarorigins_url) }
      format.xml  { head :ok }
    end
  end
end
